<?php
if( isset($_GET['redirect'] ) ){
    $headers = apache_request_headers();
    var_dump( $headers );
    var_dump( $_SERVER[ 'HTTP_REFERER' ] );
}
else {
    header('Location: /secured/prueba301_server.php?redirect=0');
}

